<?php
class Project extends AppModel {
	var $name = 'Project';
    var $displayField = "descripcion"; 
    var $fields = array('Project.descripcion', 'Project.presupuesto_asignado');
      
	var $validate = array(
		'descripcion' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'presupuesto_asignado' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		/*'company_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),  */
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Company' => array(
			'className' => 'Company',
			/*'foreignKey' => 'company_id',
			'conditions' => '',
			'fields' => '',
			'order' => '' */
		) ,
        'State' => array(
            'className' => 'State',
            /*'foreignKey' => 'company_id',
            'conditions' => '',
            'fields' => '',
            'order' => '' */
        )
	);

	/*var $hasMany = array(
		'Budget' => array(
			'className' => 'Budget',
			'foreignKey' => 'project_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'Capacitation' => array(
			'className' => 'Capacitation',
			'foreignKey' => 'project_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);  */


	var $hasAndBelongsToMany = array(
		'Month' => array(
			'className' => 'Month',
			'joinTable' => 'projects_months',
			'foreignKey' => 'project_id',
			'associationForeignKey' => 'month_id',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		)
	);

}
?>